<template>
<div>
  <!--
haspromotionTag: false
id: 1229845
img: ""
http://p1.meituan.net/w.h/movie/be4418055735904a43e41ddf4c364db81444834.jpg
https://p1.meituan.net/movie/be4418055735904a43e41ddf4c364db81444834.jpg
nm: "晴雅集"
preShow: false
rt: "2020-12-25"
sc: 0
showInfo: "2020-12-25 本周五上映"
showst: 4
star: "赵又廷,邓伦,王子文"
version: ""
wish: 234222
  -->
  <button @click="click">点击获取</button>
  <div v-for="(item, key) in movieList" :key="key">
    <span>影片:{{item['nm']}}</span>
    <span><img class="movie-poster" :src="item['img']" :alt="item['nm']"></span>
    <span><span>观影时间:{{item['rt']}}</span></span>
    <span><span>上映时间:{{item['showInfo']}}</span></span>
  </div>
</div>
</template>

<script>
import { getList } from '@/api/app'

export default {
  name: 'List',
  data () {
    return {
      movieList: []
    }
  },
  methods: {
    click () {
      const url = 'ajax/movieOnInfoList?token=&optimus_uuid=4A0D87F044CC11EB9229DD901FE5A859676FC40B0513414488C8041E582250EF&optimus_risk_level=71&optimus_code=10'
      getList(url).then(res => {
        console.log(res.data)
        const data = res.data
        data.movieList.forEach(item => {
          item.img = item.img.replace('http', 'https')
          item.img = item.img.replace('w.h/', '')
          this.movieList.push(item)
        })
        console.log(this.movieList)
      }).catch(error => {
        console.log(error)
      })
    }
  }
}
</script>

<style lang="less" scoped>
.movie-poster{
  width: 100px;
  height: 150px;
}
</style>
